<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>记录成长</title>
</head>
<script type="text/javascript" src="${base}/jstool/jquery-3.1.1.min.js"></script>

<body>

<h2>F5刷新</h2>
<h3>这是一个Restful架构风格</h3>

</body>


<script type="text/javascript">

 /* Shikong  2018年6月27日*/
	$(document).ready(function() {

		alert("请求地址：" + "${base}/rest");

		var saveDataAry = [];
		var data1 = {
			"id" : "John",
			"username" : "Doe",
			"password" : "password"
		};
		var data2 = {
			"id" : "Anna",
			"username" : "Smith",
			"password" : "password"
		};
		saveDataAry.push(data1);
		saveDataAry.push(data2);
		$.ajax({
			type : "POST",
			url : "${base}/rest/",
			beforeSend: function(request) {
				/*  设置ESB所需报文头 begin*/
				request.setRequestHeader("RequestID", "1111");
				request.setRequestHeader("SourceSystem", "OSM");
				request.setRequestHeader("TargetSystem", "ESB");
				request.setRequestHeader("ServiceName", "xxxxxx");
				/*  end*/
			},
			dataType : "json",
			contentType : "application/json",
			data : JSON.stringify(saveDataAry),
			success : function(data) {

				alert("请求响应-->ID：" + data.id );
				alert("用户名：" + data.username);
			}
		});
	});
</script>




</html>